<template>
  <div>
    <!--列表-->
    <el-table
      ref="table"
      v-loading="tableLoad"
      :data="tableData"
      fit
      highlight-current-row
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="sampleNum" label="样品编号"> </el-table-column>
      <el-table-column prop="sampleName" label="样品名称"> </el-table-column>
      <el-table-column prop="sampleModel" label="产品型号"> </el-table-column>
      <el-table-column prop="detectionItemName" label="检测项目" />
      <el-table-column prop="sampleStoreCount" label="留存数量" />
      <!-- <el-table-column prop="sampleStoreDate" label="入库日期" /> -->
      <el-table-column prop="receivingDate" label="接收日期">
        <template slot-scope="scope">
          <span>{{ formatTime(scope.row.receivingDate) }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { formatTime } from "../../../utils/time";
import { getList } from "../../../api/SampleManage/SampleStore";
export default {
  name: "SampleStoreFinished",
  components: {},
  props: {
    filterForm: {
      type: Object,
      default: () => {},
    },
    pageInfo: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      formatTime,
      dialogFormVisible: false,
      loading: false,
      tableLoad: false,
      tableData: [],
      tableDatas: [],
    };
  },
  computed: {},
  watch: {},
  created() {
    this.getList();
  },
  methods: {
    // 关闭样品接收dialog
    closeSampleReceivingDialog() {
      this.getList();
    },

    handleSelectionChange(val) {
      this.tableDatas = val;
    },
    getList(flag) {
      this.loading = true;
      getList({ ...this.filterForm, ...this.pagination })
        .then((res) => {
          this.tableData = res.data.dataList ? res.data.dataList : [];
          this.$emit("update:total", res.data.total);
          this.loading = false;
        })
        .catch(() => {
          this.loading = false;
        });
    },
  },
};
</script>
